var id = $Util.getQueryString(params, "id");
$(document).ready(function(){
	$('#submit').bind('click',subFrm);
	$('#SYSTEM_USER_ID').val(id);
	getInfo();
})

function getInfo(){
	var url = '/json?action=GET_T_SYSTEM_USER_ACTION&SYSTEM_USER_ID=' + id;
	$.post(url,{},function(data){
		if(data.success){
			var user = data.root.T_SYSTEM_USER.rs[0];
			$('#LOGIN_NAME').val(user.LOGIN_NAME);
			$('#REMARK').val(user.REMARK);
		}
		else{
			alert(data.errors.errmsg);
		}
	},'json');
}

function subFrm(){
	var options = {
	    dataType: 'json',
    	iframe:	false,
	    success: function(data) {
	    	if(data.success){
	      		location.href = adminPath + '/system/user_list.html?menu=sys_manage&tab=user_list&current_page=' + currentPage;
	      	}else{
	      		alert(data.errors.errmsg);
	      	}
	   	}
	};
	$.ajaxSetup({contentType:'application/x-www-form-urlencoded;charset=utf-8'});
    $('#frm').ajaxSubmit(options);
}
